<template>
    <div class="review-modal">
        <Modal v-model="modalShow" :width="modalWidth" :mask-closable="false" :closable="false">

            <div slot="header" style="color:#f60;text-align:center">
                <h3>{{modalTitle}}</h3>
            </div>

            <div>
                <vxe-toolbar export custom></vxe-toolbar>
                <vxe-table
                        border="none "
                        show-overflow
                        resizable
                        export-config
                        :tooltip-config="{theme:'light',enterable:true}"
                        highlight-hover-row
                        height="500"
                        size="medium"
                        align="center"
                        header-align="center"
                        :loading="tableLoading"
                        :sort-config="{trigger: 'cell'}"
                        :data="tableData">
                    <vxe-table-column type="seq" title="序号" width="60"></vxe-table-column>
                    <vxe-table-column :field="item.key" :title="item.title" min-width="120"
                                      v-for="(item,index) in tableColumn" :key="index">
                    </vxe-table-column>
                </vxe-table>
            </div>

            <div slot="footer">
                <Button type="error" size="large" long @click="submitOption">确定</Button>
            </div>
        </Modal>
    </div>
</template>

<script>
export default {
  name: 'reviewModal',
  props: {
    modalTitle: {
      type: String,
      default: () => {
        return ''
      }
    },
    modalShow: {
      type: Boolean,
      default: () => {
        return false
      }
    },
    modalWidth: {
      type: Number,
      default: () => {
        return 600
      }
    },
    tableColumn: {
      type: Array,
      default: () => {
        return []
      }
    },
    tableData: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data () {
    return {
      btnLoading: false,
      tableLoading: false,
      formItem: {}
    }
  },
  methods: {
    submitOption () {
      this.$emit('submitOption')
    },
    success (val) {
      val = this.$common.xeUtils.isEmpty(val) ? '操作成功' : val
      this.$Message.success(val)
    },
    error (data) {
      this.$Message.error({
        content: '操作失败,\n' + data.errmsg
      })
    }
  },
  mounted () {
  },
  computed: {}
}
</script>
<!--为适应vxe-table作用样式而取消scope-->
<style lang="less">
    /*解决谷歌浏览器不友好警告问题*/
    @deep: ~'>>>';

    /*单元格超出部分的tooltip*/
    body @{deep}.vxe-table--tooltip-wrapper {
        z-index: 1100 !important;
    }
    /*导出modal*/
    body @{deep}.vxe-modal--wrapper {
        z-index: 1110 !important;
    }
    .review-modal {

    }
</style>
